<template>
  <div class="stats-container">
    <div class="stats-grid">
      <div class="stat-card" v-for="(stat, index) in stats" :key="index">
        <div class="stat-icon" :style="{ backgroundColor: stat.color + '20' }">
          <i :class="stat.icon" :style="{ color: stat.color }"></i>
        </div>
        <div class="stat-info">
          <div class="stat-value">{{ stat.value }}</div>
          <div class="stat-label">{{ stat.label }}</div>
        </div>
      </div>
    </div>
    
    <div class="progress-section">
      <div class="progress-header">
        <span>运输效率</span>
        <span>92.5%</span>
      </div>
      <div class="progress-bar">
        <div class="progress-fill"></div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';

const stats = ref([
  { icon: '🚚', label: '今日运输', value: '12,458', color: '#60a5fa' },
  { icon: '📦', label: '待处理', value: '1,243', color: '#fbbf24' },
  { icon: '✅', label: '已完成', value: '11,215', color: '#4ade80' },
  { icon: '📍', label: '覆盖城市', value: '326', color: '#c084fc' }
]);
</script>

<style scoped>
.stats-container {
  background: rgba(30, 41, 59, 0.7);
  border-radius: 12px;
  padding: 20px;
  height: 100%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(94, 115, 153, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stats-grid {
  display: flex;
  gap: 20px;
}

.stat-card {
  display: flex;
  align-items: center;
  min-width: 150px;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-right: 15px;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 14px;
  color: #94a3b8;
}

.progress-section {
  width: 300px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: #e2e8f0;
  font-weight: 500;
}

.progress-bar {
  height: 10px;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 5px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 92.5%;
  background: linear-gradient(90deg, #60a5fa, #38bdf8);
  border-radius: 5px;
  position: relative;
  animation: progressAnimation 2s ease-in-out;
}

@keyframes progressAnimation {
  0% { width: 0%; }
  100% { width: 92.5%; }
}
</style>